$(function(){
    $(".go-back").on('click',function () {
        window.location = '/admin/index';
    });

    $(".btn-last-confirm").on("click",function(){
        var menuName=$(".menu-name").val();
        var menuAddr=$(".menu-addr").val();
        var player=$("input[type=checkbox]:checked");

        var form=$("form").serialize();

        if(menuName==""||menuAddr==""||player.length==0){
            layer.msg("请完善信息!")
        }else{
            ajax("post","/admin/update-admin",form,function success(data){
                if(data.code==200){
                    layer.msg(data.msg);
                    setTimeout(function(){
                        location.href="/admin/index";
                    },1200)
                }else{
                    layer.msg(data.msg);
                }
            })
        }
    })
})